import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { View, Image, Text, StyleSheet } from 'react-native'

export default class EmptyView extends Component {
  static propTypes = {
    containerStyle: PropTypes.any,
    image: PropTypes.any,
    imageStyle: PropTypes.any,
    text: PropTypes.string,
    textStyle: PropTypes.any
  }

  render () {
    return (
      <View style={[styles.container, this.props.containerStyle]}>
        <Image style={this.props.imageStyle} source={this.props.image} />
        <Text style={[styles.text, this.props.textStyle]}>
          {this.props.text || '暂无数据'}
        </Text>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: 'white'
  },
  text: {
    fontSize: 16,
    color: '#999999'
  }
})
